<?php

namespace Common\Model;
use Think\Model;

// +----------------------------------------------------------------------
// | 文件 SsoModel.class.php
// +----------------------------------------------------------------------
// | 说明 SSO的模型  package: UcenterMember
// +----------------------------------------------------------------------
// | [ channel, openid, uid  ] 
// +----------------------------------------------------------------------
// | Author: 谢赤心 Legend. <xcx_legender@qq.com>
// +----------------------------------------------------------------------

Class SsoModel extends Model
{

    public function getUid($channel, $openid)
    {
        return $this->where(compact('channel', 'openid'))->getField('uid');
    }

    public function addNew($channel, $openid, $uid)
    {
        $save = compact('channel', 'openid', 'uid');
        $res = $this->add($save);
        return $uid;
    }

}